qa-tests: use a specific version of the prebuilt db in RPC and Tip-Tracking tests#19565
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates QA RPC-related GitHub Actions workflows to use a version-pinned prebuilt DB path, intended to let release branches run against a DB compatible with that release.
Changes:
- Pin
ERIGON_REFERENCE_DATA_DIRto/opt/erigon-versions/*reference-version-3.4*/datadirin multiple RPC performance and integration workflows. - Apply the same pinning for the Gnosis RPC integration workflow.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/qa-rpc-performance-tests.yml | Pins the reference datadir used by the historic RPC performance workflow. |
| .github/workflows/qa-rpc-performance-comparison-tests.yml | Pins the reference datadir used by the “latest” RPC performance comparison workflow. |
| .github/workflows/qa-rpc-integration-tests.yml | Pins the reference datadir used by mainnet RPC integration tests. |
| .github/workflows/qa-rpc-integration-tests-remote.yml | Pins the reference datadir used by mainnet RPC integration tests (remote). |
| .github/workflows/qa-rpc-integration-tests-latest.yml | Pins the reference datadir used by “latest” mainnet RPC integration tests. |
| .github/workflows/qa-rpc-integration-tests-gnosis.yml | Pins the reference datadir used by Gnosis RPC integration tests. |
Comments suppressed due to low confidence (4)
.github/workflows/qa-rpc-integration-tests.yml:36
- This workflow triggers for both main and release/3.* (including PRs), but ERIGON_REFERENCE_DATA_DIR is now hardcoded to a 3.4 datadir. If main is supposed to keep using the main DB while release uses 3.4, make the path conditional on the target branch (use github.base_ref for PRs, github.ref_name for push/workflow_dispatch).
env:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version-3.4/datadir
ERIGON_TESTBED_AREA: /opt/erigon-testbed
ERIGON_QA_PATH: /home/qarunner/erigon-qa
ERIGON_ASSERT: true
RPC_PAST_TEST_DIR: /opt/rpc-past-tests
.github/workflows/qa-rpc-integration-tests-remote.yml:36
- This workflow triggers for both main and release/3.* (including PRs), but ERIGON_REFERENCE_DATA_DIR is now hardcoded to a 3.4 datadir. To avoid main picking up the release DB, make the reference datadir branch-dependent (github.base_ref for PRs; github.ref_name for pushes).
env:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version-3.4/datadir
ERIGON_TESTBED_AREA: /opt/erigon-testbed
ERIGON_QA_PATH: /home/qarunner/erigon-qa
ERIGON_ASSERT: true
RPC_PAST_TEST_DIR: /opt/rpc-past-tests/remote
.github/workflows/qa-rpc-integration-tests-latest.yml:40
- This workflow only runs on main, but ERIGON_REFERENCE_DATA_DIR is now pinned to reference-version-3.4. If the intent is “main uses main DB, release uses versioned DB”, this pin will prevent main from tracking the main reference DB and can cause unnecessary incompatibilities; consider using the unversioned/main reference path here and pinning only in release workflows (or making it conditional).
env:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version-3.4/datadir
ERIGON_TESTBED_DATA_DIR: /opt/erigon-testbed/datadir
ERIGON_QA_PATH: /home/qarunner/erigon-qa
TOTAL_TIME_SECONDS: 900 # 15 minutes
REFERENCE_SYSTEM_HOST_ADDRESS: 157.180.55.78:8545
.github/workflows/qa-rpc-integration-tests-gnosis.yml:36
- This workflow triggers for both main and release/3.* (including PRs), but ERIGON_REFERENCE_DATA_DIR is now hardcoded to the 3.4 gnosis reference datadir. If main should continue using the unversioned gnosis reference DB, make this path conditional based on github.ref/base_ref so main and release can diverge as intended.
env:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/gnosis-reference-version-3.4/datadir
ERIGON_TESTBED_AREA: /opt/erigon-testbed
ERIGON_QA_PATH: /home/qarunner/erigon-qa
ERIGON_ASSERT: true
RPC_PAST_TEST_DIR: /opt/rpc-past-tests
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ersion' into qa-tests/rpc_test_use_specific_version
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Set reference data dir based on branch | ||
| run: | | ||
| # For pull_request events base_ref is the target branch name; for push/dispatch parse from ref. | ||
| BRANCH="${{ github.base_ref }}" | ||
| if [ -z "$BRANCH" ]; then | ||
| BRANCH="${{ github.ref }}" | ||
| BRANCH="${BRANCH#refs/heads/}" | ||
| fi | ||
| if [[ "$BRANCH" == release/* ]]; then | ||
| VERSION="${BRANCH#release/}" | ||
| MAJOR="${VERSION%.*}" | ||
| MINOR="${VERSION##*.}" | ||
| PREV_VERSION="${MAJOR}.$((MINOR - 1))" | ||
| echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/reference-version-${PREV_VERSION}/datadir" >> $GITHUB_ENV | ||
| else | ||
| echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/reference-version/datadir" >> $GITHUB_ENV | ||
| fi |
There was a problem hiding this comment.
ERIGON_REFERENCE_DATA_DIR is being set via $GITHUB_ENV, but later steps use the expression ${{ env.ERIGON_REFERENCE_DATA_DIR }} (e.g., the pre-sync command builds a path from it). The env expression context won’t reflect values written to $GITHUB_ENV, so this will expand to an empty string at workflow-evaluation time. Use the shell variable $ERIGON_REFERENCE_DATA_DIR in run: blocks, and for places that need expressions (like with.path) expose the computed value as a step output and reference steps.<id>.outputs.<name> (or keep a job-level env: expression instead of $GITHUB_ENV).
| VERSION="${BRANCH#release/}" | ||
| MAJOR="${VERSION%.*}" | ||
| MINOR="${VERSION##*.}" |
There was a problem hiding this comment.
The PREV_VERSION calculation can underflow for branches like release/3.0 (producing 3.-1) or break if the release branch format isn’t strictly X.Y. Add validation/guarding (e.g., fail fast with a clear error or handle the 0 case explicitly) before writing the computed path to $GITHUB_ENV.
| VERSION="${BRANCH#release/}" | |
| MAJOR="${VERSION%.*}" | |
| MINOR="${VERSION##*.}" | |
| VERSION="${BRANCH#release/}" | |
| # Expect VERSION in the form X.Y where X and Y are numeric. | |
| if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then | |
| echo "Error: Unsupported release branch format '$BRANCH'. Expected 'release/X.Y'." >&2 | |
| exit 1 | |
| fi | |
| MAJOR="${VERSION%.*}" | |
| MINOR="${VERSION##*.}" | |
| # Prevent underflow for minor version 0 (e.g., 3.0 would produce 3.-1). | |
| if [ "$MINOR" -eq 0 ]; then | |
| echo "Error: Cannot compute previous version for '$BRANCH' because minor version is 0." >&2 | |
| exit 1 | |
| fi |
| - name: Set reference data dir based on branch | ||
| run: | | ||
| # For pull_request events base_ref is the target branch name; for push/dispatch parse from ref. | ||
| BRANCH="${{ github.base_ref }}" | ||
| if [ -z "$BRANCH" ]; then | ||
| BRANCH="${{ github.ref }}" | ||
| BRANCH="${BRANCH#refs/heads/}" | ||
| fi | ||
| if [[ "$BRANCH" == release/* ]]; then | ||
| VERSION="${BRANCH#release/}" | ||
| MAJOR="${VERSION%.*}" | ||
| MINOR="${VERSION##*.}" | ||
| PREV_VERSION="${MAJOR}.$((MINOR - 1))" | ||
| echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version-${PREV_VERSION}/datadir" >> $GITHUB_ENV | ||
| else | ||
| echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version/datadir" >> $GITHUB_ENV | ||
| fi |
There was a problem hiding this comment.
Same issue as mainnet: ERIGON_REFERENCE_DATA_DIR is set via $GITHUB_ENV, but ${{ env.ERIGON_REFERENCE_DATA_DIR }} is still used later in the workflow. Since the env expression context won’t include runtime $GITHUB_ENV updates, any ${{ env.* }} use will resolve empty. Prefer $ERIGON_REFERENCE_DATA_DIR in shell commands and/or publish the computed path as a step output for use in expressions.
| MAJOR="${VERSION%.*}" | ||
| MINOR="${VERSION##*.}" | ||
| PREV_VERSION="${MAJOR}.$((MINOR - 1))" | ||
| echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version-${PREV_VERSION}/datadir" >> $GITHUB_ENV |
There was a problem hiding this comment.
The PREV_VERSION computation can produce invalid paths for release/3.0 (or any *.0) and assumes a strict X.Y branch naming. Add a guard/validation (and a clear failure message) so the workflow doesn’t silently point at a non-existent reference DB directory.
| MAJOR="${VERSION%.*}" | |
| MINOR="${VERSION##*.}" | |
| PREV_VERSION="${MAJOR}.$((MINOR - 1))" | |
| echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version-${PREV_VERSION}/datadir" >> $GITHUB_ENV | |
| # Expect VERSION in the form X.Y (e.g. 3.1) | |
| if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then | |
| echo "Error: unsupported release branch name '$BRANCH'. Expected format 'release/X.Y' (e.g. 'release/3.1')." >&2 | |
| exit 1 | |
| fi | |
| MAJOR="${VERSION%.*}" | |
| MINOR="${VERSION##*.}" | |
| if [ "$MINOR" -eq 0 ] 2>/dev/null; then | |
| echo "Error: cannot compute previous minor version for branch '$BRANCH' (minor component is 0)." >&2 | |
| exit 1 | |
| fi | |
| PREV_VERSION="${MAJOR}.$((MINOR - 1))" | |
| REF_DIR="/opt/erigon-versions/gnosis-reference-version-${PREV_VERSION}/datadir" | |
| if [ ! -d "$REF_DIR" ]; then | |
| echo "Error: reference data directory '$REF_DIR' does not exist for release branch '$BRANCH'." >&2 | |
| exit 1 | |
| fi | |
| echo "ERIGON_REFERENCE_DATA_DIR=$REF_DIR" >> $GITHUB_ENV |
This PR allows us to use different DB versions between main branch and release branch to avoid any incompatibility problems between databases